package com.linkhub.oms.admin.modules.logistic.domain.dto;

import com.linkhub.oms.common.util.QtBeanUtil;
import com.linkhub.oms.common.util.QtStreamUtil;
import com.linkhub.oms.entity.LogisticEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: ShippingChannelDTO
 * @Author: echo
 * @Date: 2024/5/25 11:55
 * @Version: 1.0
 */
@Data
public class ShippingChannelDTO implements Serializable {

    private String channelCode;

    private String channelEName;

    public static ShippingChannelDTO convert(LogisticEntity logisticEntity) {
        ShippingChannelDTO dto = new ShippingChannelDTO();
        QtBeanUtil.copyProperties(logisticEntity, dto);
        return dto;

    }

    public static List<ShippingChannelDTO> map(List<LogisticEntity> list) {
        return QtStreamUtil.map(list, ShippingChannelDTO::convert);
    }
}
